package la.iok.hzsvn.lewin.movie.shopmovie.entity;

import java.util.Date;
import java.util.Objects;

/**
 * 优惠券使用记录
 */
public class CouponUseRecord {
    /**
     * 创建状态，也是初始状态
     */
    public static Integer STATUS_CREATED = 0;
    /**
     * 已确认状态
     */
    public static Integer STATUS_CONFIRMED = 10;
    private Long id;
    /**
     * 拼车id
     */
    private Long carpoolId;
    /**
     * 优惠券id
     */
    private Long couponId;
    /**
     * 抵扣的收费项id
     */
    private Long playerFeeId;
    /**
     * 抵扣金额，单位分
     */
    private Integer amount;
    /**
     * 使用的店铺。当前是发放优惠券的店铺。将来可能会有平台券
     */
    private Long orgUnitId;
    /**
     * 持有优惠券的玩家用户id
     */
    private Long userId;
    /**
     * 使用时间
     */
    private Date time;
    /**
     * 确认优惠券使用的人。再返用户
     */
    private Long confirmUserId;

    /**
     * 优惠券使用确认时间
     */
    private Date confirmTime;
    /**
     * 状态。0：创建状态，也是默认状态。10：已确认,使用券经过确认并返现给了用户。0-10之间的状态保留
     */
    private Integer status;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCarpoolId() {
        return carpoolId;
    }

    public void setCarpoolId(Long carpoolId) {
        this.carpoolId = carpoolId;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public Long getPlayerFeeId() {
        return playerFeeId;
    }

    public void setPlayerFeeId(Long playerFeeId) {
        this.playerFeeId = playerFeeId;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Long getOrgUnitId() {
        return orgUnitId;
    }

    public void setOrgUnitId(Long orgUnitId) {
        this.orgUnitId = orgUnitId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Long getConfirmUserId() {
        return confirmUserId;
    }

    public void setConfirmUserId(Long confirmUserId) {
        this.confirmUserId = confirmUserId;
    }

    public Date getConfirmTime() {
        return confirmTime;
    }

    public void setConfirmTime(Date confirmTime) {
        this.confirmTime = confirmTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CouponUseRecord)) return false;
        CouponUseRecord record = (CouponUseRecord) o;
        return Objects.equals(id, record.id) && Objects.equals(carpoolId, record.carpoolId) && Objects.equals(couponId, record.couponId)
                && Objects.equals(playerFeeId, record.playerFeeId) && Objects.equals(amount, record.amount)
                && Objects.equals(orgUnitId, record.orgUnitId) && Objects.equals(userId, record.userId)
                && Objects.equals(time, record.time) && Objects.equals(confirmUserId, record.confirmUserId)
                && Objects.equals(confirmTime, record.confirmTime) && Objects.equals(status, record.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, carpoolId, couponId, playerFeeId, amount, orgUnitId, userId, time, confirmUserId, confirmTime, status);
    }

    @Override
    public String toString() {
        return "CouponUseRecord{" +
                "id=" + id +
                ", carpoolId=" + carpoolId +
                ", couponId=" + couponId +
                ", playerFeeId=" + playerFeeId +
                ", amount=" + amount +
                ", orgUnitId=" + orgUnitId +
                ", userId=" + userId +
                ", time=" + time +
                ", confirmUserId=" + confirmUserId +
                ", confirmTime=" + confirmTime +
                ", status=" + status +
                '}';
    }
}
